maintainer="Hoang Nguyen <folliekazetani@protonmail.com>"
pkgname=kubectl-oidc_login
pkgver=1.30.1
pkgrel=0
pkgdesc="kubectl plugin for Kubernetes OpenID Connect authentication"
url="https://github.com/int128/kubelogin"
arch="all !armhf !riscv64 !loongarch64" # blocked by kubernetes
license="Apache-2.0"
depends="kubectl"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/int128/kubelogin/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/kubelogin-$pkgver"
options="net" # download Go modules

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -v -ldflags "-X main.version=$pkgver"
}

check() {
	go test ./...
}

package() {
	install -Dm755 kubelogin "$pkgdir"/usr/bin/kubectl-oidc_login
}

sha512sums="
124407cec3f50c0fbe12a4a33fade7065314f07fbe8c2187d5bd06e3291abf53f3c412dbbf4440f13b195193143636d8f9f2480e4f0f6be44334031fe5e7a733  kubectl-oidc_login-1.30.1.tar.gz
"
